<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2021/4/5
  Time: 10:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录</title>
</head>
<body>
<%--两种引用方法
    @include 会把两个页面合二为一。如果变量重定义会报错。
    jsp 是拼接页面，实质上是两个
--%>
<%@ include file="head.jsp"%>
<jsp:include page="head.jsp"></jsp:include>
<%--jsp声明--%>
<%!
    public void fx(){
        System.out.println("a");
    }
%>

<%--jsp表达式--%>
<%= new java.util.Date()%>
<hr>
<%
    int sum = 0;
    for (int i = 0; i < 100; i++) {
        sum+=i;
    }
    out.println("<h1> Sum = "+sum+"</h1>");
%>
<%
    for (int i = 0; i < 5; i++) {
%>
<h1>hello</h1>
<%
    }
%>
<h1>登录</h1>
<%--这里表单表示的意思，以post方式提交表单，提交至log请求--%>
<div style = "text-align: center">
    <form action= "${pageContext.request.contextPath}/log" method="post">
        Username:<input type="text" name="name" ><br>
        pwd:<input type="password" name="password" ><br>
        hobbit:
        <input type="checkbox" name="hobby" value="a"> a
        <input type="checkbox" name="hobby" value="b"> b
        <input type="checkbox" name="hobby" value="c"> c
        <input type="checkbox" name="hobby" value="d"> d

        <br>
        <input type="submit">
    </form>

</div>

</body>
</html>
